package com.abysscore.yachtdesign.view;

import java.awt.MenuItem;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

import com.abysscore.yachtdesign.FreeShipController;

public class FreeShipMenuBar {
	//private static MenuItem fileSaveMenuItem;
	private JMenuBar menuBar;
	
	private JMenu fileMenu;
	private JMenu projectMenu;
	private JMenu editMenu;
	private JMenu pointMenu;
	private JMenu edgeMenu;
	private JMenu curveMenu;
	private JMenu faceMenu;
	private JMenu layerMenu;
	private JMenu visibilityMenu;
	private JMenu selectionMenu;
	private JMenu toolsMenu;
	private JMenu transformMenu;
	private JMenu calculationsMenu;
	private JMenu windowMenu;
	private JMenu helpMenu;
	
	private JFrame appFrame;

	private ActionListener freeShipMenuListener;

	private FreeShipController control;
	
	public FreeShipMenuBar(FreeShipController Control, JFrame frame)
	{
		control = Control;
		appFrame = frame;
		menuBar = new javax.swing.JMenuBar();
		
	    InitMenus();
	    appFrame.setJMenuBar(menuBar);
	    
	}
	private void InitMenus()
	{
		fileMenu = new FreeShipFileMenu(control);
		
		populateProjectMenu();
		populateEditMenu();
		populatePointMenu();
		populateEdgeMenu();
		populateCurveMenu();
		populateFaceMenu();
		populateLayerMenu();
		populateVisibilityMenu();
		populateSelectionMenu();
		populateToolsMenu();
		populateTransformMenu();
		populateCalculationsMenu();
		populateWindowMenu();
		populateHelpMenu();
		
	    menuBar.add(fileMenu);
	    menuBar.add(projectMenu);
	    menuBar.add(editMenu);
	    menuBar.add(pointMenu);
	    menuBar.add(edgeMenu);
	    menuBar.add(curveMenu);
	    menuBar.add(layerMenu);
	    menuBar.add(visibilityMenu);
	    menuBar.add(selectionMenu);
	    menuBar.add(toolsMenu);
	    menuBar.add(transformMenu);
	    menuBar.add(calculationsMenu);
	    menuBar.add(windowMenu);
	    menuBar.add(helpMenu);
	    
	}
	
	private void populateProjectMenu()
	{
		projectMenu = new JMenu("Project");
	}
	private void populateEditMenu()
	{
		editMenu = new JMenu("Edit");
	}
	private void populatePointMenu()
	{
		pointMenu = new JMenu("Point");
	}
	private void populateEdgeMenu()
	{
		edgeMenu = new JMenu("Edge");
	}
	private void populateCurveMenu()
	{
		curveMenu = new JMenu("Curve");
	}
	private void populateFaceMenu()
	{
		faceMenu = new JMenu("Face");
	}
	private void populateLayerMenu()
	{
		layerMenu = new JMenu("Layer");
	}
	private void populateVisibilityMenu()
	{
		visibilityMenu = new JMenu("Visibility");
	}
	private void populateSelectionMenu()
	{
		selectionMenu = new JMenu("Selection");
	}
	private void populateToolsMenu()
	{
		toolsMenu = new JMenu("Tools");
	}
	private void populateTransformMenu()
	{
		transformMenu = new JMenu("Transform");
	}
	private void populateCalculationsMenu()
	{
		calculationsMenu = new JMenu("Calculations");
	}
	private void populateWindowMenu()
	{
		windowMenu = new JMenu("Window");
	}
	private void populateHelpMenu()
	{
		helpMenu = new JMenu("Help");
	}
}
